package com.demo2do.fms.entity.vehicle.source;

import com.demo2do.core.utils.Alias;

/**
 * 车辆审核状态
 * 
 * @author Wy
 */
@Alias("LockStatus")
public enum LockStatus {
    
    LOCKED("locked", "锁定"),
    
    UNLOCKED("unlocked", "解锁");

    private String alias;
    
    private String description;

    /**
     * @param alias
     * @param description
     */
    private LockStatus(String alias , String description) {
        this.alias = alias;
        this.description = description;
    }
    
    /**
     * 
     * @param alias
     * @return
     */
    public static LockStatus aliasOf(String alias){
        
        for(LockStatus auditStatus : LockStatus.values()){
            if(auditStatus.getAlias().equals(alias)){
                
                return auditStatus;
            }
        }
        return null;
    }
    
    /**
     * 
     * @return
     */
    public boolean isUnlocked() {
        return this.equals(UNLOCKED);
    }
    
    /**
     * 
     * @return
     */
    public boolean isLocked() {
        return this.equals(LOCKED);
    }
    
    /**
     * @return  alias
     */
    public String getAlias() {
        return alias;
    }
    
    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }

}
